package com.wx.jwt.config;

import com.wx.jwt.filter.JwtFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author wx
 * @Description: 过滤器配置
 * @date 2018/11/27 002711:42
 */
@Configuration
public class FilterConfig {

    /**
     * @methodName: loginFilter
     * @author: wx
     * @description: JWT过滤器
     * @param
     * @date: 2018/9/15
     * @return: org.springframework.boot.web.servlet.FilterRegistrationBean
     */
    @Bean
    public FilterRegistrationBean jwtFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean(new JwtFilter());
        registration.addUrlPatterns("/save");
        registration.addUrlPatterns("/list");
        registration.setName("jwtFilter");
        return registration;
    }

}
